home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / Data.cab / _1F5A4A0AF85B4C8694ED7BFC6C7C7F76 < prev    next >
Encoding:
Text File  |  2004-04-29  |  1.0 KB  |  61 lines

  1.  
  2. regc(2, "COMBINED_XFORM")
  3. regc(6, "MODEL_XFORM")
  4.  
  5. regc(12, "FOG_PARAMS")
  6.  
  7. regc(13, "CAMERA_POS_MS")
  8. regcn(14, "DIRECTIONAL_DIR_MS", 0)
  9.  
  10. regc(20, "TEXTURE1_XFORM")
  11.  
  12. // ------------ c40 - c60 reserved
  13. !include("vs_spot_consts.inc")
  14.  
  15. vshader("
  16.  
  17. #define point        v0
  18. #define normal        v1
  19. #define tangent        v2
  20. #define tcoord        v3
  21.  
  22. #define fogp    c12
  23. #define cpos    c13
  24. #define ldir    c14
  25.  
  26. #include    <fog.inc>
  27.  
  28.     vs_1_1
  29.  
  30.     dcl_position    point
  31.     dcl_normal    normal
  32.     dcl_tangent    tangent
  33.     dcl_texcoord    tcoord
  34.  
  35.     ; output position
  36.     m4x4    oPos, point, c2
  37.     dp3        r4.x, normal, ldir        ; diffuse N*L
  38.  
  39.     ; output diffuse
  40.     mov        oD0.w, r4.x   //  sun
  41.  
  42. ;------------------------------------------
  43. // spot lights
  44. // used r0 - r2
  45. #if VS_SPOTLIGHTS
  46. #include <vs_spot_func.inc>
  47. #endif
  48. ;----------------------------
  49.     ; output texcoords
  50.     mov        oT0, tcoord           // broken
  51.  
  52.     ; terrain lightmap texgen (from model space)
  53.     dp4        oT1.x, point, c20
  54.     dp4        oT1.y, point, c21
  55.  
  56.     ; calc fog
  57.        dp4    r0.x, point, c4
  58.        FOG(r0.x, fogp, r10)
  59. ")
  60.  
  61.